<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: interface.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: interface.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>
/**
 * An automatically generated file, based on interface.html.
 * An interesting problem in web development is managing HTML
 * code in JS files. Rather than embedding string literals and
 * concatenating them, or some other hackish soluion,
 * we simply convert an HTML file to a JS string. Therefore,
 * relevant edits should be in interface.html instead.
 *
 * The BlockPyInterface global can be seen as a constant
 * representation of the default interface.
 */
BlockPyInterface = "&lt;div class='blockpy-content container-fluid' style='background-color :#fcf8e3; border: 1px solid #faebcc; '>    &lt;div class='blockpy-popup modal fade' style='display:none'>        &lt;div class='modal-dialog' style='width:750px'>            &lt;div class='modal-content' id='modal-message' >                &lt;div class='modal-header'>                    &lt;button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&amp;times;&lt;/button>                    &lt;h4 class='modal-title'>Dynamic Content&lt;/h4>                &lt;/div>                &lt;div class='modal-body' style='width:100%; height:400px; white-space:pre-wrap'>                &lt;/div>                &lt;div class='modal-footer'>                    &lt;button type='button' class='btn btn-white' data-dismiss='modal'>Close&lt;/button>                &lt;/div>                &lt;/div>        &lt;/div>    &lt;/div>    &lt;canvas id='capture-canvas' style='display:none'>&lt;/canvas>    &lt;div class='row' style='padding-bottom: 10px; border-bottom: 1px solid #faebcc; '>        &lt;div class='blockpy-content-top col-md-9 col-sm-9'>            &lt;span class='blockpy-alert pull-right text-muted' data-bind=\"visible: false, text: status.text\">&lt;/span>            &lt;strong>BlockPy: &lt;/strong>             &lt;span class='blockpy-presentation-name'                  data-bind='text: assignment.name'>&lt;/span>            &lt;div class='blockpy-presentation' data-bind=\"html: assignment.introduction\">            &lt;/div>        &lt;/div>        &lt;div class='blockpy-content-topright col-md-3 col-sm-3'>            &lt;span class='text-muted' data-bind=\"visible: status.dataset_loading().length\">Loading Dataset!&lt;/span>            &lt;span class='pull-right label label-default blockpy-status-box'                  data-bind=\"css: status_server_class()[0],                             text: status_server_class()[1],                             attr: { 'data-original-title': status.server_error }\"                  data-toggle=\"tooltip\" data-placement=\"left\">Loading&lt;/span>            &lt;div class='pull-right'>                Disable Semantic Errors: &lt;input type='checkbox' data-bind=\"checked: settings.disable_semantic_errors\">&lt;br>                Disable Timeout: &lt;input type='checkbox' data-bind=\"checked: settings.disable_timeout\">&lt;br>                Disable Typed Blocks: &lt;input type='checkbox' data-bind=\"checked: settings.disable_variable_types\">&lt;br>                                &lt;label class='blockpy-toolbar-auto-upload' data-bind=\"visible: settings.instructor\">                Auto-save:                &lt;input type='checkbox' data-bind=\"checked:settings.auto_upload\">&lt;br>                &lt;/label>                                &lt;label class='blockpy-toolbar-instructor-mode' data-bind=\"visible: settings.instructor_initial\">                Instructor mode:                 &lt;input type='checkbox' data-bind=\"checked:settings.instructor\">&lt;br>                &lt;/label>                                &lt;label class='blockpy-toolbar-instructor-mode' data-bind=\"visible: settings.instructor_initial\">                Upload mode:                 &lt;input type='checkbox' data-bind=\"checked:assignment.upload\">&lt;br>                &lt;/label>             &lt;/div>            &lt;!--&lt;img src=\"images/corgi.png\" class='img-responsive' />-->        &lt;/div>    &lt;/div>    &lt;div class='row' style='margin-top: 5px border: 1px solid #bce8f1;'>        &lt;div class='blockpy-content-left col-md-6 col-sm-6'             style='padding:10px'>            &lt;strong>Printer&lt;/strong>            &lt;div class='blockpy-printer blockpy-printer-default'>            &lt;/div>        &lt;/div>        &lt;div class='blockpy-content-right col-md-6 col-sm-6 bubble'             style='padding:10px'>            &lt;div class='blockpy-feedback'>                &lt;button type='button' class='btn btn-sm btn-default blockpy-feedback-trace pull-right'                         data-bind=\"visible: !execution.show_trace() &amp;&amp; (status.error() == 'feedback' || status.error() == 'no errors'|| status.error() == 'complete')\">                    &lt;span class='glyphicon glyphicon-circle-arrow-down'>&lt;/span> Trace Variables                &lt;/button>                                &lt;strong>Feedback: &lt;/strong>                &lt;span class='label blockpy-feedback-status' data-bind=\"css: status_feedback_class()[0], text: status_feedback_class()[1]\">Runtime Error&lt;/span>                &lt;br>                &lt;pre class='blockpy-feedback-original'>&lt;/pre>                &lt;strong class='blockpy-feedback-title'>&lt;/strong>                &lt;div class='blockpy-feedback-body'>&lt;i>Run your code to get feedback.&lt;/i>&lt;/div>                &lt;div class='blockpy-code-trace'>&lt;/div>                                &lt;!-- ko if: execution.show_trace -->                &lt;div class=\"blockpy-feedback-traces\">                                &lt;div>                    &lt;button type='button' class='btn btn-default' data-bind=\"click: moveTraceFirst\">                        &lt;span class='glyphicon glyphicon-step-backward'>&lt;/span>                    &lt;/button>                    &lt;button type='button' class='btn btn-default' data-bind=\"click: moveTraceBackward\">                        &lt;span class='glyphicon glyphicon-backward'>&lt;/span>                    &lt;/button>                    Step &lt;span data-bind='text: execution.trace_step()'>&lt;/span>                    / &lt;span data-bind='text: execution.last_step()-1'>&lt;/span>                    (&lt;span data-bind='text: current_trace().line == -1 ? \"The end\" : \"Line \"+current_trace().line'>&lt;/span>)                    &lt;button type='button' class='btn btn-default' data-bind=\"click: moveTraceForward\">                        &lt;span class='glyphicon glyphicon-forward'>&lt;/span>                    &lt;/button>                    &lt;button type='button' class='btn btn-default' data-bind=\"click: moveTraceLast\">                        &lt;span class='glyphicon glyphicon-step-forward'>&lt;/span>                    &lt;/button>                &lt;/div>                                &lt;table class='table table-condensed table-striped table-bordered table-hover'>                    &lt;thead>                        &lt;tr>&lt;th>Name&lt;/th>&lt;th>Type&lt;/th>&lt;th>Value&lt;/th>&lt;/tr>                    &lt;/thead>                    &lt;tbody data-bind=\"foreach: current_trace().properties\">                        &lt;tr data-bind=\"visible: name != '__file__' &amp;&amp; name != '__path__'\">                            &lt;td data-bind=\"text: name\">&lt;/td>                            &lt;td data-bind=\"text: type\">&lt;/td>                            &lt;td>                                &lt;code data-bind=\"text: value\">&lt;/code>                                &lt;!-- ko if: type == \"List\" -->                                &lt;a href=\"\" data-bind=\"click: $root.viewExactValue(type, exact_value)\">                                &lt;span class='glyphicon glyphicon-new-window'>&lt;/span>                                &lt;/a>                                &lt;!-- /ko -->                            &lt;/td>                        &lt;/tr>                    &lt;/tbody>                &lt;/table>                                &lt;/div>                &lt;!-- /ko -->                            &lt;/div>        &lt;/div>    &lt;/div>    &lt;div class=\"row\"         style='background-color :#fcf8e3; padding-bottom: 10px; border: 1px solid #faebcc'>        &lt;div class='col-md-12 col-sm-12 blockpy-toolbar btn-toolbar' role='toolbar'>                        &lt;button type='button' class='btn blockpy-run' style='float:left',                data-bind='css: execution.status() == \"running\" ? \"btn-info\" :                                execution.status() == \"error\" ? \"btn-danger\" : \"btn-success\" ' >                &lt;span class='glyphicon glyphicon-play'>&lt;/span> Run            &lt;/button>                        &lt;div class=\"btn-group\" data-toggle=\"buttons\" data-bind=\"visible: !assignment.upload()\">                &lt;label class=\"btn btn-default blockpy-mode-set-blocks\"                        data-bind=\"css: {active: settings.editor() == 'Blocks'}\">                    &lt;span class='glyphicon glyphicon-th-large'>&lt;/span>                    &lt;input type=\"radio\" name=\"blockpy-mode-set\" autocomplete=\"off\" checked> Blocks                &lt;/label>                &lt;label class=\"btn btn-default blockpy-mode-set-instructor\"                       data-bind=\"visible: settings.instructor,                                  css: {active: settings.editor() == 'Upload'}\">                    &lt;span class='glyphicon glyphicon-list-alt'>&lt;/span>                    &lt;input type=\"radio\" name=\"blockpy-mode-set\" autocomplete=\"off\"> Instructor                &lt;/label>                &lt;label class=\"btn btn-default blockpy-mode-set-split\"                       data-bind=\"css: {active: settings.editor() == 'Split'}\">                    &lt;span class='glyphicon glyphicon-resize-horizontal'>&lt;/span>                    &lt;input type=\"radio\" name=\"blockpy-mode-set\" autocomplete=\"off\"> Split                &lt;/label>                &lt;label class=\"btn btn-default blockpy-mode-set-text\"                        data-bind=\"css: {active: settings.editor() == 'Text'}\">                    &lt;span class='glyphicon glyphicon-pencil'>&lt;/span>                    &lt;input type=\"radio\" name=\"blockpy-mode-set\" autocomplete=\"off\"> Text                &lt;/label>            &lt;/div>            &lt;button type='button' class='btn btn-default blockpy-toolbar-reset' data-bind=\"visible: !assignment.upload()\">                &lt;span class='glyphicon glyphicon-refresh'>&lt;/span> Reset            &lt;/button>            &lt;!--&lt;button type='button' class='btn btn-default blockpy-toolbar-capture'>                &lt;span class='glyphicon glyphicon-picture'>&lt;/span> Capture            &lt;/button>-->            &lt;button type='button' class='btn btn-default blockpy-toolbar-import' data-bind=\"visible: !assignment.upload() &amp;&amp; (assignment.importable() || settings.instructor())\">                &lt;span class='glyphicon glyphicon-cloud-download'>&lt;/span> Import Datasets            &lt;/button>            &lt;button type='button' class='btn btn-default blockpy-toolbar-history'>                &lt;span class='glyphicon glyphicon-hourglass'>&lt;/span> History            &lt;/button>            &lt;!--            &lt;button type='button' class='btn btn-default blockpy-toolbar-english'>                &lt;span class='glyphicon glyphicon-list-alt'>&lt;/span> English            &lt;/button>            -->                        &lt;select data-bind=\"visible: settings.instructor() &amp; !assignment.upload(), value: settings.filename\"                    class=\"blockpy-toolbar-filename-picker\">                &lt;option value='__main__' selected>Student Code&lt;/option>                &lt;option value='starting_code'>Starting Code&lt;/option>                &lt;option value='give_feedback'>Generate Feedback&lt;/option>            &lt;/select>                        &lt;/div>    &lt;/div>    &lt;div class='row blockpy-content-bottom'         style='padding-bottom: 10px; border: 1px solid #faebcc'>        &lt;div class='blockpy-editor col-md-12 col-sm-12'>            &lt;div class='blockpy-blocks blockpy-editor-menu'                  style='height:100%'>                &lt;div class='blockly-div' style='height:450px; width: 100%' '>&lt;/div>                &lt;!-- &lt;div class='blockly-area'>&lt;/div> -->            &lt;/div>            &lt;div class='blockpy-text blockpy-editor-menu' style='height: 450px'>                &lt;div class='blockpy-text-sidebar' style='width:150px; height: 100%; float:left; background-color: #ddd'>                &lt;!--                &lt;button type='button' class='btn btn-default blockpy-text-insert-if'>Decision (If)&lt;/button>                &lt;button type='button' class='btn btn-default blockpy-text-insert-if-else'>Decision (If/Else)&lt;/button>                -->                &lt;/div>                &lt;textarea class='codemirror-div language-python'                           style='height:100%'>&lt;/textarea>            &lt;/div>            &lt;div class='blockpy-upload blockpy-editor-menu'>                &lt;label class=\"btn btn-default btn-file\">                    Browse &lt;input type=\"file\" style=\"display: none;\">                &lt;/label>            &lt;/div>            &lt;div class='blockpy-instructor blockpy-editor-menu form-inline'>                &lt;!-- Name -->                &lt;br>                &lt;form class=\"form-inline\" style='display:inline-block'>                &lt;label>Name:&lt;/label>                &lt;input type='text' class='blockpy-presentation-name-editor form-control'                       data-bind='textInput: assignment.name'>                 &lt;/form>                &lt;br>                &lt;br>                                &lt;label>Introduction:&lt;/label>                &lt;div class='blockpy-presentation-body-editor'>                 &lt;/div>                                &lt;!-- Parsons -->                &lt;label class='blockpy-presentation-parsons-check'>                Parsons:                &lt;input type='checkbox' class='form-control' data-bind=\"checked:assignment.parsons\">                &lt;/label>                 &lt;br>                                &lt;!-- Importable Datasets -->                &lt;label class='blockpy-presentation-importable-check'>                Able to import datasets:                &lt;input type='checkbox' class='form-control' data-bind=\"checked:assignment.importable\">                &lt;/label>                 &lt;br>                                &lt;!-- Algorithm Errors -->                &lt;label class='blockpy-presentation-importable-check'>                Disable Algorithm Errors:                &lt;input type='checkbox' class='form-control' data-bind=\"checked:assignment.disable_algorithm_errors\">                &lt;/label>                 &lt;br>                                &lt;!-- Initial mode -->                &lt;label class='blockpy-presentation-text-first'>                Initial View:                &lt;select data-bind=\"value: assignment.initial_view\">                    &lt;option value=\"Blocks\" selected>Blocks&lt;/option>                    &lt;option value=\"Text\">Text&lt;/option>                    &lt;option value=\"Instructor\">Instructor&lt;/option>                    &lt;option value=\"Upload\">Upload&lt;/option>                &lt;/select>                &lt;/label>                &lt;br>                                &lt;label>Available Modules&lt;/lable>                &lt;select class='blockpy-available-modules' multiple='multiple'                        data-bind=\"selectedOptions: assignment.modules\">                    &lt;option>Properties&lt;/option>                    &lt;option>Decisions&lt;/option>                    &lt;option>Iteration&lt;/option>                    &lt;option>Functions&lt;/option>                    &lt;option>Calculation&lt;/option>                    &lt;option>Output&lt;/option>                    &lt;option>Turtles&lt;/option>                    &lt;option>Python&lt;/option>                    &lt;option>Values&lt;/option>                    &lt;option>Lists&lt;/option>                    &lt;option>Dictionaries&lt;/option>                    &lt;option>Data - Parking&lt;/option>                            &lt;/div>            &lt;div class='blockpy-upload blockpy-editor-menu'>            &lt;/div>        &lt;/div>    &lt;/div>    &lt;div>        &lt;div class='blockpy-content-right col-md-5 col-sm-5 alert alert-info'>            &lt;div class='panel panel-default'>                &lt;div class='panel-heading'>Data Explorer&lt;/div>                &lt;div class='panel-body'>                &lt;div class='blockpy-explorer'>                    &lt;table>&lt;tr>                    &lt;!-- Step: X of Y (Line: Z) -->                    &lt;td colspan='4'>                        &lt;div class='blockpy-explorer-run-hide'>                            &lt;i>Run your code to explore it.&lt;/i>                        &lt;/div>                        &lt;div class='blockpy-explorer-status'>                            &lt;strong>Step: &lt;/strong>                            &lt;span class='blockpy-explorer-step-span'>0&lt;/span> of                             &lt;span class='blockpy-explorer-length-span'>0&lt;/span>                             (&lt;strong>Line: &lt;/strong>                            &lt;span class='blockpy-explorer-line-span'>0&lt;/span>)                        &lt;/div>                    &lt;/td>                    &lt;/tr>&lt;tr>                    &lt;!-- First Previous Next Last -->                    &lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-first'>                        &lt;span class='glyphicon glyphicon-fast-backward'>&lt;/span> First&lt;/button>                    &lt;/td>&lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-back'>                        &lt;span class='glyphicon glyphicon-backward'>&lt;/span> Back&lt;/button>                    &lt;/td>&lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-next'>                        Next &lt;span class='glyphicon glyphicon-forward'>&lt;/span>&lt;/button>                    &lt;/td>&lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-last'>                        Last &lt;span class='glyphicon glyphicon-fast-forward'>&lt;/span> &lt;/button>                    &lt;/td>                    &lt;/tr>&lt;/table>                    &lt;!-- Printer -->                                        &lt;!-- Modules -->                    &lt;br>&lt;div>                        &lt;strong>Loaded Modules: &lt;/strong>                        &lt;i class='blockpy-explorer-modules'>None&lt;/i>                    &lt;/div>                    &lt;!-- Actual Trace data -->                    &lt;br>&lt;strong>Trace Table&lt;/strong>                    &lt;br>&lt;table style='width: 100%'                            class='table table-condensed table-striped                                    table-bordered table-hover blockpy-explorer-table'>                        &lt;!-- Property Type Value -->                        &lt;tr>                            &lt;th>Property&lt;/th>                            &lt;th>Type&lt;/th>                            &lt;th>Value&lt;/th>                        &lt;/tr>                    &lt;/table>                &lt;/div>                &lt;/div>            &lt;/div>        &lt;/div>    &lt;/div>&lt;/div>&lt;!--&lt;div class='blockpy-explorer-errors alert alert-danger alert-dismissible' role='alert'>                     &lt;button type='button' class='blockpy-explorer-errors-hide close' aria-label='Close'>&lt;span  aria-hidden='true'>&amp;times;&lt;/span>&lt;/button>                     &lt;div class='blockpy-explorer-errors-body'>                                     &lt;/div>-->";
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BlockPy.html">BlockPy</a></li><li><a href="BlockPyCorgis.html">BlockPyCorgis</a></li><li><a href="BlockPyDialog.html">BlockPyDialog</a></li><li><a href="BlockPyEditor.html">BlockPyEditor</a></li><li><a href="BlockPyEngine.html">BlockPyEngine</a></li><li><a href="BlockPyEnglish.html">BlockPyEnglish</a></li><li><a href="BlockPyFeedback.html">BlockPyFeedback</a></li><li><a href="BlockPyHistory.html">BlockPyHistory</a></li><li><a href="BlockPyPresentation.html">BlockPyPresentation</a></li><li><a href="BlockPyPrinter.html">BlockPyPrinter</a></li><li><a href="BlockPyServer.html">BlockPyServer</a></li><li><a href="BlockPyToolbar.html">BlockPyToolbar</a></li><li><a href="LocalStorageWrapper.html">LocalStorageWrapper</a></li><li><a href="PythonToBlocks.html">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href="global.html#BlockPyInterface">BlockPyInterface</a></li><li><a href="global.html#cloneNode">cloneNode</a></li><li><a href="global.html#encodeHTML">encodeHTML</a></li><li><a href="global.html#expandArray">expandArray</a></li><li><a href="global.html#EXTENDED_ERROR_EXPLANATION">EXTENDED_ERROR_EXPLANATION</a></li><li><a href="global.html#indent">indent</a></li><li><a href="global.html#instructor_module">instructor_module</a></li><li><a href="global.html#prettyPrintDateTime">prettyPrintDateTime</a></li><li><a href="global.html#randomInteger">randomInteger</a></li><li><a href="global.html#set_button_loaded">set_button_loaded</a></li><li><a href="global.html#timerGuard">timerGuard</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
